import React, { Component } from 'react'
import PropTypes from 'prop-types'
export default class List extends Component {
  // 添加props校验
  static propTypes = {
    list: PropTypes.array.isRequired,
  }

  // 添加props默认值
  static defaultProps = {
    list: ['大傻子', '要写list属性', 'list的值是数组'],
  }
  render() {
    return (
      <ul>
        {this.props.list.map((item) => {
          return <li key={item}>{item}</li>
        })}
      </ul>
    )
  }
}

// List.propTypes = {

// }
